import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
Vue.config.productionTip = false


Vue.filter("fdate", (val) => {
  let date = new Date(val * 1000); //实例化日期对象

  return date.toLocaleString().replace(/\//g, "-").replace(/(上午|下午)/, '');

  // let year = data.getFullYear();
  // let month = date.getMonth()+1;
})

import VueQuillEditor from 'vue-quill-editor'
// require styles 导入富文本编辑器对应的样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)


//全局过滤器——自己写日期格式化方法
// Vue.filter('formatDate1', function (val) {
//   let date = new Date(val * 1000);
//    //注意对方给你的是毫秒还是秒，如果是毫秒需要转秒（*1000）
//     let y = date.getFullYear();
//   let MM = date.getMonth() + 1;
//   MM = MM < 10 ? ('0' + MM) : MM;
//   let d = date.getDate();
//   d = d < 10 ? ('0' + d) : d;
//   let h = date.getHours();
//   h = h < 10 ? ('0' + h) : h;
//   let m = date.getMinutes();
//   m = m < 10 ? ('0' + m) : m;
//   let s = date.getSeconds();
//   s = s < 10 ? ('0' + s) : s;
//   return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
//   })



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
